package com.hao.jdbctemplate.dao.impl;

import com.hao.jdbctemplate.dao.UserDao;
import com.hao.jdbctemplate.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

/**
 * TODO
 *
 * @author 97472
 * @version 1.0
 * @date 2021/11/5 16:12
 */
@Service
public class UserDaoImpl implements UserDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void add(User user){
        String sql = "insert into s_user (name,addr,username,password) values(?,?,?,?)";
        int update = jdbcTemplate.update(sql, user.getName(), user.getAddr(), user.getUsername(), user.getPassword());
    }
}
